import dayjs from 'dayjs'
import 'dayjs/locale/zh-cn'
import rTime from 'dayjs/plugin/relativeTime'
dayjs.extend(rTime)
dayjs.locale('zh-cn')

export const formatDate = date => {
  return dayjs().to(date)
}

export const formatTime = date => {
  return dayjs(date).format('YYYY-MM-DD')
}
